#-*- coding: utf-8 -*-
import os
import sys
from PIL import Image

inPath = "../image/avatars-fgowiki/"
outPath = "../image/avatars/"
listfile=os.listdir(inPath)
# print(listfile)

for filename in listfile:
    inFile = inPath + filename
    im = Image.open(inFile)
    outFile = outPath + filename[0:3] + ".png"
    im_rgba = im.convert("RGBA")
    blank = (0,0,0,0)
    
    for y in range(0,10):
        for x in range(0,10-y):
            im_rgba.putpixel((x,y), blank)
            im_rgba.putpixel((128-x-1,y), blank)

    im_rgba.putpixel((0,138), blank)
    im_rgba.putpixel((0,139), blank)
    im_rgba.putpixel((1,139), blank)
    im_rgba.putpixel((127,138), blank)
    im_rgba.putpixel((127,139), blank)
    im_rgba.putpixel((126,139), blank)

    im_rgba.save(outFile, "PNG", )
    print(filename[0:3], im.format, im.size, im.mode)

